namespace JHT.EFMigrationTest.ClassLibrary1.Migrations
{
    using System;
    using System.Data.Entity.Migrations;
    
    public partial class InitialCreate : DbMigration
    {
        public override void Up()
        {
            CreateTable(
                "dbo.ClassInfo",
                c => new
                    {
                        Id = c.Long(nullable: false, identity: true),
                        ClassName = c.String(nullable: false, maxLength: 50, unicode: false),
                    })
                .PrimaryKey(t => t.Id);
            
            CreateTable(
                "dbo.Students",
                c => new
                    {
                        Id = c.Long(nullable: false, identity: true),
                        AssignedClassId = c.Long(nullable: false),
                        StudentName = c.String(maxLength: 50, unicode: false),
                        Gender = c.Int(),
                    })
                .PrimaryKey(t => t.Id)
                .ForeignKey("dbo.ClassInfo", t => t.AssignedClassId)
                .Index(t => t.AssignedClassId);
            
        }
        
        public override void Down()
        {
            DropForeignKey("dbo.Students", "AssignedClassId", "dbo.ClassInfo");
            DropIndex("dbo.Students", new[] { "AssignedClassId" });
            DropTable("dbo.Students");
            DropTable("dbo.ClassInfo");
        }
    }
}
